/* rewodisp.p - REPETITIVE                                                    */
/* Copyright 1986-2011 QAD Inc., Santa Barbara, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Id:: rewodisp.p 2366 2010-11-10 01:47:19Z zzh                          $: */
/* $Revision: 1.6.1.5 $                                                           */
/*                                                                            */
/* SUBPROGRAM TO DISPLAY INFO FROM THE CUM WORKORDER wo_mstr RECORD           */
/*                                                                            */
/* REVISION: 7.3        LAST MODIFIED: 10/31/94   BY: WUG *GN77*              */
/* REVISION: 7.3        LAST MODIFIED: 03/29/95   BY: WUG *F0PN*              */
/* REVISION: 8.6        LAST MODIFIED: 10/14/97   BY: mzv *K0YF*              */
/* REVISION: 8.6E       LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane        */
/* REVISION: 8.6E       LAST MODIFIED: 05/29/98   BY: *K1R8* A. Shobha        */
/* REVISION: 8.6E       LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan       */
/* REVISION: 9.1        LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown       */
/* REVISION: 9.1        LAST MODIFIED: 09/11/00   BY: *N0RQ* Mudit Mehta      */
/* Revision: 1.6.1.3  BY: Robin McCarthy DATE: 10/01/01 ECO: *P025* */
/* Revision: 1.6.1.5.3.1  BY: Paul Donnelly (SB) DATE: 06/28/03 ECO: *Q00K* */
/*-Revision end---------------------------------------------------------------*/

/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{us/bbi/mfdeclre.i}
{us/bbi/gplabel.i}

define input parameter cumwo_lot as character.

define variable wostatus as character format "x(20)"
   label "Status".
define variable active_wolot as character.
define variable i as integer.
define variable mfg_type as character label "Mfg Type" format "x(9)" no-undo.

find wo_mstr  where wo_mstr.wo_domain = global_domain and  wo_lot = cumwo_lot
no-lock.

find si_mstr  where si_mstr.si_domain = global_domain and  si_site = wo_site
no-lock no-error.
find pt_mstr  where pt_mstr.pt_domain = global_domain and  pt_part = wo_part
no-lock no-error.
find ln_mstr  where ln_mstr.ln_domain = global_domain and  ln_site = wo_site
   and ln_line = wo_line
no-lock no-error.

for first ptal_mstr where ptal_mstr.ptal_domain = global_domain
   and ptal_part             = wo_part
   and ptal_active
no-lock:
end.

form
   wo_lot       colon 20
   wo_routing   colon 95
   wo_site      colon 20
   si_desc      at 42 no-label
   wo_bom_code  colon 95
   wo_part      colon 20
   pt_desc1     at 42 no-label
   wo_rel_date  colon 95 label "Start Eff"
   ptal_alt_part   colon 20
   mfg_type     colon 95
   wo_line      colon 20
   ln_desc      at 42 no-label
   wo_due_date  colon 95 label "End Eff"
   wo_qty_ord   colon 95 label "Order Qty"
   wostatus     colon 95
   skip(1)
with frame f-a width 132 side-labels.

/* SET EXTERNAL LABELS */
setFrameLabels(frame f-a:handle).

if wo_status = "C" then
   wostatus = getTermLabel("CLOSED",20).
else do:

   if wo_due_date < today then
      wostatus = getTermLabel("EXPIRED",20).
   else
      wostatus = getTermLabel("ACTIVE",20).
end.

for first lngd_det where lngd_dataset     = "wo_mstr"
   and lngd_field       = "orderType"
   and lngd_lang        = global_user_lang
   and lngd_key1        = wo_mfg_type
no-lock:
mfg_type = lngd_key2.
end.

display
   wo_site
   wo_part
   wo_line
   wo_routing
   wo_bom_code
   wo_rel_date
   wo_due_date
   wo_lot
   wostatus
   mfg_type
   ptal_alt_part when available(ptal_mstr)
   pt_desc1        when (available pt_mstr)
   si_desc         when (available si_mstr)
   ln_desc         when (available ln_mstr)
   wo_qty_ord
with frame f-a.

{us/gp/gpcmtprt.i &id=wo_cmtindx &pos=14}

